<form class="form-horizontal">
	<div class="tip-wrap">
		<div {{bind-attr class=":alert alertType formTip::hide"}}><strong>{{formTip}}</strong></div>
	</div>

	<div class="container confing-packetfilter-main form-horizontal">
		{{!-- <h3 class="">IP: {{analyzerIp}}</h3>
		<div class="control-group">
			<label class="control-label">缺省策略</label>
			<div class="controls">
				{{view "select"
					class="span4"
					content=defaultpolicys
					optionLabelPath="content.displaytext"
					optionValuePath="content.value"
					value=form.glopolicy}}
			</div>
		</div> --}}
		<div class="control-group">
			{{!-- <label class="control-label">过滤策略</label> --}}
			<div class="control-group pickerfilter-options">
				<button class="u-btn-danger op-delete" {{action "delPolicy"}} disabled={{noneRulesChecked}}>删除</button>
				<button class="u-btn-blue op-add" {{action "openDialog"}}>添加</button>
				<button class="u-btn-blue op-save ml10" {{action "save"}}>保存</button>
			</div>
			<table class="conf-table conf-packetf-tab">
				<thead>
					<tr>
						<th class="config-tab-th tc" width="80">
							{{input type="checkbox" checked=checkedAll}}
						</th>
						<th class="config-tab-th" width="130">源IP</th>
						<th class="config-tab-th" width="80">源端口</th>
						<th class="config-tab-th" width="130">目的IP</th>
						<th class="config-tab-th" width="80">目的端口</th>
						<th class="config-tab-th">策略</th>
						<th class="config-tab-th">操作</th>
					</tr>
				</thead>
				<tbody>
					{{#each policyRules as |policyRule|}}
					<tr>
						<td class="tc">
							{{input type="checkbox" checked=policyRule.checked}}
						</td>
						<td>
							{{policyRule.sIp}}
						</td>
						<td>
							{{policyRule.sPort}}
						</td>
						<td>
							{{policyRule.dIp}}
						</td>
						<td>
							{{policyRule.dPort}}
						</td>
						<td>
							{{policyRule.policyName}}
						</td>
						<td>
							<button class="u-btn-danger" {{action "singleDelPolicy" policyRule}}>删除</button>
							<button class="u-btn-blue" {{action "upPriority" policyRule}} title="上移">上移</button>
							<button class="u-btn-blue" {{action "downPriority" policyRule}} title="下移">下移</button>
						</td>
					</tr>
					{{else}}
					<tr>
						<td colspan="7" class="tc">当前没有数据</td>
					</tr>
					{{/each}}
				</tbody>
			</table>
		</div>
		{{!-- <div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<button class="btn btn-primary" {{action "save"}}>保存</button>
			</div>
		</div> --}}
	</div>
</form>

{{#view view.Dialog
	id="packet_filter_add"
	title="添加过滤策略"
	autoOpen=false
	modal=true
	width=600
	height=400 
	class="common-popUp filter-add"
	buttons=dialogButtons}}
	<div id="dialog">

		<div {{bind-attr class=":alert alertType saveResult::hide"}}><strong>{{saveResult}}</strong></div>
		<div class="control-group">
			<label class="group-title">源IP</label>
			<div class="group-content">
				{{input class="input u-input-blue" value=form.sourceIp}}&nbsp;&nbsp;-&nbsp;
				{{input class="input u-input-blue" value=form.sourceIp1 tooltip="源IP地址范围，如192.168.0.1表示单机,192.168.0.1-192.168.0.10表示范围" }}
			</div>
		</div>

		<div class="control-group">
			<label class="group-title">源端口</label>
			<div class="group-content">
				{{input class="input u-input-blue" value=form.sourcePort}}&nbsp;&nbsp;-&nbsp;
				{{input class="input u-input-blue" value=form.sourcePort1 tooltip="源端口范围，如8080表示单个端口， 80-1000表示范围"}}
			</div>
		</div>

		<div class="control-group">
			<label class="group-title">目的IP</label>
			<div class="group-content">
				{{input class="input u-input-blue" value=form.ip}}&nbsp;&nbsp;-&nbsp;
				{{input class="input u-input-blue" value=form.ip1 tooltip="IP地址范围，如192.168.0.1表示单机,192.168.0.1-192.168.0.10表示范围" }}
			</div>
		</div>

		<div class="control-group">
			<label class="group-title">目的端口</label>
			<div class="group-content">
				{{input class="input u-input-blue" value=form.port}}&nbsp;&nbsp;-&nbsp;
				{{input class="input u-input-blue" value=form.port1 tooltip="端口范围，如8080表示单个端口， 80-1000表示范围"}}
			</div>
		</div>
		<div class="control-group">
			<label class="group-title">策略</label>
			<div class="group-content">
				{{view "select"
				class="filterPolicy u-input-blue"
				content=defaultpolicys
				optionLabelPath="content.displaytext"
				optionValuePath="content.value"
				value=form.policys}}

				{{!-- {{view view.select
					class="form-top-select form-top-select-app span4"
					content=defaultpolicys
					selectValue=form.policys
					optionLabelPath="displaytext"
					optionValuePath="value"
				}} --}}
			</div>
		</div>

		<div class="control-group">
			<div class="group-options">
				<button type="submit" {{action "addPolicy"}} class="u-btn-blue">确定</button>
				<button type="button" {{action "closeDialog"}} class="u-btn-blue">取消</button>
			</div>
		</div>
	</div>	
{{/view}}

{{#view view.Dialog
	id="packet_filter_upd"
	title="修改过滤策略"
	autoOpen=false
	modal=true
	width=355
	height=380
	buttons=dialogButtons}}
	<div id="dialog">
		<div {{bind-attr class=":alert alertType saveResult::hide"}}><strong>{{saveResult}}</strong></div>
			<div class="control-group">
			<label class="control-label">IP地址范围</label>
			<div class="controls">
				{{input class="input span2" value=form.ip}}&nbsp;&nbsp;-&nbsp;
				{{input class="input span2" value=form.ip1 tooltip="IP地址范围，如192.168.0.1表示单机,192.168.0.1-192.168.0.10表示范围" }}
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">端口范围</label>
			<div class="controls">
				{{input class="input span2" value=form.port}}&nbsp;&nbsp;-&nbsp;
				{{input class="input span2" value=form.port1 tooltip="端口范围，如8080表示单个端口， 80-1000表示范围"}}
			</div>
		</div>		
		<div class="control-group">
			<label class="control-label">策略</label>
			<div class="controls">
				{{view "select"
				class="span4"
				content=defaultpolicys
				optionLabelPath="content.displaytext"
				optionValuePath="content.value"
				value=form.policys}}
			</div>
		</div>

		<div class="control-group">
			<div class="controls">
				<button type="submit" {{action "updPolicy"}} class="btn btn-primary">确定</button>
				<button type="button" {{action "updCloseDialog"}} class="btn">取消</button>
			</div>
		</div>
	</div>	
{{/view}}